var share_obj={
		shareConfig_init:function(config){
			wx.config({
			    debug: false,
			    appId: config.appid,
			    timestamp: config.timestamp,
			    nonceStr: config.nonceStr,
			    signature: config.signature,
			    jsApiList: [
			      	'checkJsApi',
			        'onMenuShareTimeline',
			        'onMenuShareAppMessage',
			        'onMenuShareQQ',
			        'onMenuShareWeibo',
			        'hideMenuItems',
			        'showMenuItems',
			        'hideAllNonBaseMenuItem',
			        'showAllNonBaseMenuItem',
			        'translateVoice',
			        'startRecord',
			        'stopRecord',
			        'onRecordEnd',
			        'playVoice',
			        'pauseVoice',
			        'stopVoice',
			        'uploadVoice',
			        'downloadVoice',
			        'chooseImage',
			        'previewImage',
			        'uploadImage',
			        'downloadImage',
			        'getNetworkType',
			        'openLocation',
			        'getLocation',
			        'hideOptionMenu',
			        'showOptionMenu',
			        'closeWindow',
			        'scanQRCode',
			        'chooseWXPay',
			        'openProductSpecificView',
			        'addCard',
			        'chooseCard',
			        'openCard'
			    ]
		  });
		},
		
		
		share_init:function(share){
			if(typeof(share.img_url)=='undefined' || !share.img_url){
				share.img_url=domain.www+'/Wechat/api/images/logo.png';
			}
			(typeof(share.link)=='undefined' || !share.link) && (share.link=window.location.href);
			(typeof(share.title)=='undefined' || !share.title) && (share.title=document.title);
			(typeof(share.desc)=='undefined' || !share.desc) && (share.desc=share.title);
			(typeof(share.trans)=='undefined' || !share.trans) && (share.trans=1);
				
			var share_res=function(share_to){
				share.share_to=share_to;
				share.do_action='action.share';
				$.post('./', share);
			}
			var appmessage_share={
				'img_url':share.img_url,
				'link':share.url,
				'title':share.title,
				'desc':share.desc
			}
			var timeline_share={
				'img_url':share.img_url,
				'link':share.url,
				'title':share.title,
				'desc':share.desc
			}
			
		  wx.ready(function(){
			  wx.onMenuShareTimeline({
				    title: timeline_share.title, 
				    link: timeline_share.link,
				    imgUrl: timeline_share.img_url, 
				    desc: timeline_share.title, 
				    success: function () { 
				        // 用户确认分享后执行的回调函数
				    	$.post('?s=history/share');
				    },
				    cancel: function () { 
				        // 用户取消分享后执行的回调函数
				    }
				});
			  wx.onMenuShareAppMessage({
				  	title: appmessage_share.title, 
				    link: appmessage_share.link,
				    imgUrl: appmessage_share.img_url, 
				    desc: appmessage_share.title, 
				    type: '', // 分享类型,music、video或link，不填默认为link
				    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
				    success: function () { 
				        // 用户确认分享后执行的回调函数
				    	$.post('?s=history/share');
				    },
				    cancel: function () { 
				        // 用户取消分享后执行的回调函数
				    }
				});
			});
			
		},
		
}